using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;
using System.Xml.Serialization;
using EnvDTE;
using Microsoft.VisualStudio.Shell.Interop;
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;
using System.Windows;
using System.Windows.Input;
using System.Threading;
using System.Windows.Threading;
using System.Net;

namespace WebAppUploader
{
	public class TempFolder : IDisposable
	{
		private DirectoryInfo folder;

		public TempFolder(string key)
		{
			folder = new DirectoryInfo(Path.GetTempPath() + "WebUploader\\" + key);
			if (!folder.Exists)
				folder.Create();
		}

		public string CreateTempFile(string name)
		{
			return folder.FullName + "\\" + name;
		}

		#region public void  Dispose()
		public void Dispose()
		{
			try
			{
				folder.Delete(true);
			}
			catch { }
		}
		#endregion

	}
}
